package com.cjx.util;

import java.sql.Connection;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class GetData {
	public List<HashMap> getRoundList(){
		List<HashMap> list = null;
		GetConnection conn = new GetConnection();
		Connection con = conn.getConn();
		String sql = "select * from roundinfo order by pk desc";
		list = conn.query(con, sql);
		return list;
	}
	public List<HashMap> getGroupList(String roundid){
		List<HashMap> list = null;
		GetConnection conn = new GetConnection();
		Connection con = conn.getConn();
		String sql = "select * from groupinfo where roundid="+roundid+" order by pk desc";
		list = conn.query(con, sql);
		return list;
	}
	//根据roundid取得该轮信息
	public List<HashMap> getRoundinfo(String roundid){
		List<HashMap> list = null;
		GetConnection conn = new GetConnection();
		Connection con = conn.getConn();
		String sql = "select * from roundinfo where roundid="+roundid;
		list = conn.query(con, sql);
		return list;
	}
	//根据pk取得该局信息
	public List<HashMap> getGroupinfo(String pk){
		List<HashMap> list = null;
		GetConnection conn = new GetConnection();
		Connection con = conn.getConn();
		String sql = "select * from groupinfo where pk="+pk;
		list = conn.query(con, sql);
		return list;
	}
	//根据roundid取得该局信息
	public List<HashMap> getGroup(String roundid){
		List<HashMap> list = null;
		GetConnection conn = new GetConnection();
		Connection con = conn.getConn();
		String sql = "select * from groupinfo where roundid="+roundid;
		list = conn.query(con, sql);
		return list;
	}
	//根据roundid取得该局统计信息
	public List<HashMap> getStaistics(String roundid){
		List<HashMap> list = null;
		GetConnection conn = new GetConnection();
		Connection con = conn.getConn();
		String sql = "select * from statisticss where roundid='"+roundid+"' order by pk";
		list = conn.query(con, sql);
		return list;
	}
}
